<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Mem Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['prefix' => 'auth'], function ($router) {
    Route::post('logout', 'AuthController@logout');
    Route::group(['middleware'=>'memJWT'],function () {
        Route::post('refresh', 'AuthController@refresh');
        Route::post('me', 'AuthController@me');
        Route::post('me-update', 'AuthController@userInfoUpdate');
        Route::post('me-new', 'VisitController@newUser');//新增用户
    });
});

Route::resource('article','ArticleController');     //文章
Route::get('today-daily-sign','DailySignController@today'); //每日签
Route::resource('product','DrinkController');         //产品
Route::get('category','DrinkController@category');         //产品分类
Route::get('banners','DrinkFocusController@index');   //焦点图
Route::get('frontend-seting','BaseController@frontendSeting');   //参数设置
Route::get('today-potable','DrinkController@todayPotable');   //今日适饮
Route::get('search','SearchController@search');         //搜索

Route::group(['middleware'=>'memJWT'],function (){
    Route::resource('my','MyController');               //我的信息
    Route::resource('point','UserPointController');     //我的积分
    Route::resource('bonus','BonusController');         //我的分红
    Route::resource('withdraw','WithdrawController');   //我的提现

    Route::resource('collect','WantDrinkController');//我的收藏
    Route::post('collect-cancel','WantDrinkController@cancel');//删除想喝的酒
    Route::post('article-collect-cancel','ArticleCollectionController@cancel');//删除收藏的文章
    Route::resource('address','AddressController');//收货地址
    Route::resource('location','LocationController');//定位地址
    Route::post('address/{id}/default','AddressController@setDefault');//设置默认收货地址


    //订单模块
    Route::resource('order','OrderController');//订单
    Route::post('order/{id}/cancel','OrderController@cancel');//取消订单
    Route::post('order/{id}/delete','OrderController@delete');//删除订单
    Route::post('order/{id}/complete','OrderController@complete');//确认收获
    Route::post('order/{id}/consumepay','OrderController@consumePay');//确认收获

});